<template>
  <div class="dashboard-container">
    <!-- 首页总览标题 -->
    <div class="dashboard-header">
      <h2>重明—以太坊虚拟机安全检测平台介绍</h2>
    </div>

    <!-- 系统功能展示模块 -->
    <div class="features-section">
      <h3>系统功能展示：</h3>
      <el-row>
        <el-col :span="8">
          <el-card class="feature-card feature-color-1">
            <h4>自动化测试用例生成</h4>
          </el-card>
        </el-col>
        <el-col :span="8">
          <el-card class="feature-card feature-color-2">
            <h4>实现多平台测试</h4>
          </el-card>
        </el-col>
        <el-col :span="8">
          <el-card class="feature-card feature-color-3">
            <h4>自动化错误检测</h4>
          </el-card>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-card class="feature-card feature-color-4">
            <h4>漏洞检测与定位</h4>
          </el-card>
        </el-col>
        <el-col :span="8">
          <el-card class="feature-card feature-color-5">
            <h4>测试样例多样化</h4>
          </el-card>
        </el-col>
        <el-col :span="8">
          <!-- 使用 div 或者其他交互性更好的元素 -->
          <div @click="goToTestReports">
            <el-card class="feature-card feature-color-6">
              <h4>测试报告查询/下载</h4>
            </el-card>
          </div>
        </el-col>

      </el-row>
    </div>

    <!-- 系统优势模块 -->
    <div class="advantages-section">
      <h3>系统优势：</h3>
      <el-card shadow="hover" class="advantages-card">
        <ul>
          <li v-for="(advantage, index) in advantages" :key="index" :class="`advantage-item-${index % 4}`">
            {{ advantage }}
          </li>
        </ul>
      </el-card>
    </div>

    <!-- 快速操作按钮 -->
    <div class="quick-actions">
      <el-button type="primary" class="quick-action-button" @click="startNewTest">
        <i class="el-icon-plus" /> 快速操作：开始新测试
      </el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Dashboard',
  data() {
    return {
      advantages: [
        '全面的操作码级别生成，保证EVM测试高覆盖率。',
        '多语言EVM实现的对比，确保一致性和安全性。',
        '自动化、智能化的测试流程，提高测试效率，节约开发成本。',
        '丰富的可视化界面展示，直观反馈测试进展和结果。'
      ]
    }
  },
  methods: {
    startNewTest() {
      // 跳转到差分测试页面
      this.$router.push('/differential-testing/index')
    },
    goToTestReports() {
    // 跳转到测试报告页面
      this.$router.push('/test-reports/index')
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard-header {
  text-align: center;
  margin-bottom: 20px;

  h2 {
    font-size: 36px; /* 更大字体 */
    font-weight: bold;
    color: #2c3e50; /* 深色字体 */
    letter-spacing: 3px; /* 增加字间距 */
    text-transform: uppercase; /* 字母大写 */
    background: linear-gradient(90deg, #3498db, #2ecc71); /* 渐变背景 */
    -webkit-background-clip: text; /* 用背景裁剪文字 */
    color: transparent; /* 背景渐变渲染在文字上 */
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1); /* 添加轻微阴影 */
  }
}

h3 {
  font-size: 28px; /* 增大字体 */
  font-weight: 600; /* 调整字重 */
  color: #34495e; /* 使用稍微深色的字体 */
  text-align: left;
  position: relative;
  padding-bottom: 10px;
  margin-bottom: 20px;

  /* 增加一个底部边框 */
  &:after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 50px;
    background: linear-gradient(90deg, #3498db, #2ecc71); /* 底部渐变色 */
    border-radius: 2px;
  }
}
.dashboard-container {
  margin: 30px;

  .dashboard-header {
    text-align: center;
    margin-bottom: 20px;
    h2 {
      font-size: 32px;
      font-weight: bold;
      color: #34495e;
      letter-spacing: 2px;
    }
  }

  .quick-actions {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
  }

  .quick-action-button {
    background: linear-gradient(135deg, #3498db, #2ecc71); /* 深色渐变按钮背景 */
    color: #fff;
    border: none;
    font-size: 18px;
    padding: 14px 35px;
    border-radius: 30px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
  }

  .quick-action-button:hover {
    background: linear-gradient(135deg, #2ecc71, #3498db);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
  }

  .quick-action-button i {
    margin-right: 8px;
  }

  .features-section {
    margin-bottom: 40px;
  }

  h3 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #2c3e50;
  }

  /* 统一功能展示卡片的风格 */
  .feature-card {
  padding: 20px;
  min-height: 150px;
  text-align: center;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.4s ease;

  h4 {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
  }

  &:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
  }
}

  .feature-color-1 {
    background: linear-gradient(135deg, #ff7979, #ff6f61);
    color: #ffffff;
  }

  .feature-color-2 {
    background: linear-gradient(135deg, #6a89cc, #4a69bd);
    color: #ffffff;
  }

  .feature-color-3 {
    background: linear-gradient(135deg, #f8c291, #e77f67);
    color: #ffffff;
  }

  .feature-color-4 {
    background: linear-gradient(135deg, #78e08f, #38ada9);
    color: #ffffff;
  }

  .feature-color-5 {
    background: linear-gradient(135deg, #82ccdd, #60a3bc);
    color: #ffffff;
  }

  .feature-color-6 {
    background: linear-gradient(135deg, #fad390, #f6b93b);
    color: #ffffff;
  }

  .advantages-section {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #0b92ec48, #9cc7f1);
    border-radius: 20px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    color: #ffffff;

    h3 {
      font-size: 22px;
      font-weight: bold;
      color: #ffffff;
      margin-bottom: 20px;
    }

    .advantages-card {
      background-color: rgba(255, 255, 255, 0.1);
      border-radius: 15px;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
      padding: 15px;
    }

    ul {
      padding-left: 0;
      list-style: none;

      li {
        padding: 10px 0;
        font-size: 20px;
        font-weight: 500;
        color: #ffffff;
        transition: transform 0.3s ease, color 0.3s ease;
      }

      /* 让每个优势项有不同的颜色，增加视觉吸引力 */
      .advantage-item-0 {
        color: #f39c12;
      }

      .advantage-item-1 {
        color: #1abc9c;
      }

      .advantage-item-2 {
        color: #3498db;
      }

      .advantage-item-3 {
        color: #e74c3c;
      }

      li:hover {
        transform: translateY(-5px);
        color: #0ac8f8;
      }
    }
  }
}
</style>

